//导入 mongoose
const mongoose = require('mongoose');
const roleModel = require('./roleModel')
//创建文档的结构对象
//设置集合中文档的属性以及属性值的类型
let adminSchema = new mongoose.Schema({
  username: String,
  roleName:String,
  roleId:{type: mongoose.Schema.Types.ObjectId,ref:roleModel},
  password: String,
  avatar:String
});

//创建模型对象  对文档操作的封装对象
let adminModel = mongoose.model('admin', adminSchema);

//暴露模型对象
module.exports = adminModel;
